Fixed some issues with mac building.