more fixes to work on mac