Crash fixes. Cleaned up permissions.