#699 - Attempt to fix JSCompatibility problems for Tomcat 6

(cherry picked from commit c958461b751346536bd9a7dde87571c9f5596c68)