Fix backslashes not getting replaced on Windows

The current fix for replacing backslashes with forward slashes in paths on Windows doesn't work. This fixes it.