Removed .gitignore~, added error handling