Fix history searching with up/down error.

One minor thing still requires fixing: if you have nothing on your command
line, and you hit up/down to go through history, the cursor remains at the
beginning of line. This is different behaviour than what's expected when you do
it in bash. Something to get used to? Or maybe possible to change.