Updated to compile on Mac