Improved remote repository exception handling.
Removed some unused imports