Fix a few script errors, fix htaccess