Various selection behaviour fixes broken during IME feature