Fix compilation warnings by using return not exit.