Fixed bug in via cleanup control flow