Fixes for running on Mac