Fix a bug in Shift+arrow select function.