A few improvements + Tomcat compat