Unrecursive version of moveNil.