Fix tests on master

These changes fix all tests for me on OSX. Let's see if travis likes it too...