Modifications following code review
Fixed rmdir under Windows/MINGW