compile fixes for macosx