Fixes for Windows paths

Nothing was working for me on Windows but was for others on Unix-like systems. I debugged it and found out that it couldn't open my file because of path resolving issues, and that was failing silently. So I made it throw an error instead of failing silently, and did some simplifying and replaced backslashes with forward slashes before resolving the full path.