Fixed error (permissions)
Some cleanup and fixed stuff