[PATCH] fix klist semantics for lists which have elements removed on traversal