Fixed bug when a command is invalid. Added to-do.