Terminal interface bugs fixed