Fix use of unix directory separators on Windows

Also some minor formatting changes.