Fixed most issues due to permissions

Failing on database connection which is expected at this point.