Tested in OS X, some other changes