some bugfixes in term