Fixes some errors and improve the error handling.
Improved the remove feature.

Now it detects automatically if a path is a folder (rather than having to use the / at the end of the line).
Also, fixes some 2to3 porting issues.