Fixed tomcat bugs