Fixes issues with deleting files and cleanup on windows.

[minor] "Java 6-compatible"...?