BUG: fixes for Mac builds