bugfixes for windows and subdirectories