Fix problems with the servlet based codes. The last revision in the branch.