Fixed cursor positioning on OS X.