Fixed directory permissions and mod_rewrite in setup script