Fix bugs in selection / focus