compile fixes for mac