Fixed permissions and fixed nullpointer error.