Fixed some bugs in console