Fixes #1237, need to test on Mac