Fix 'getSelectionEnd'