Fixed some permissions, and added some documentation