Fixed some minor behavior problems in cursor movement and pageup/pagedown.