Fix error in windows

Fix error resulting from mixing slashes with backslashes in the call for _dirname which doesn't resolve the right path