Fix minor bug and add new test case "console"