Remove debug output, fix some bugs and add command prompt