Add needed fixes for Mac OS support