Some bug fixes, command history