Fixed to work better on OS X