Cleaning up permissions, and fixing #142