Fixed issue #9 and fixed another issue on wrongly updating current term in truncate