Many fixes and command history.

Many little fixes and a great thing: we have command history now. :)