Improved error handling. Added clean option to syncing directories.