Just fixed some bugs and add terminal_clear();