Try to make Cmd+W work on OS X (#934).