fixed some bugs in read-command.c