Add exit guards for package builds.