Now this almost builds on Windows
Fixed some 'I don't know how it worked' bugs