Minor fixes to compile in OSX