Moves form close tag to correct place in hierarchy.