fixes for mac - ihaaaaaaaa my first commit from mac in a life!