Some fixes for Mac