Compatibility fix for cursor position