Fixing .htaccess handling of slashes

Also fixed a javascript error that could happen on first load