Move closing body after error checking.