Improved error handling and added a way to change permissions in
Filesystem.