Added some fixes to make test bench to work on OSX