Fixing issue #16

I believe this can be merged to master as well to work on Mac.