More validation and cross-browser fixes