Fixed directory handling for Windows.