Fix selection on last line bug