Bugfixes for JS compilation and validation options

All of these are fixes for issues that I encountered when building a form for a project I'm working on.

They have only been tested with PHP-5.2.6-3ubuntu4.5 w/ Suhosin-0.9.6.2 and jQuery-1.8.3.