Removing redundant node and cleaning up exit.