Fixed build in OSX.
Fixed driver code to work with non-Windows OSes.