more fixes to run on Mac OSx