fixed compilation errors on mac