Fixed bugs in taking in input commands