Fixes wrong reference to window.getSelection