Fixed permission problems and setup script