some fixes for mac build