Fixing Bugs - Some Windows Stuff

Now using Windows, so I can test it on Windows. Cleaned up some spelling
mistakes and also some resource leaks.
Not 100% tested but should hopefully be fine.