Fixed some bugs and added new input commands.