Filter types inside while
More correct ssa for while loop when restoring variables