Found a problem that wasn't allowing the exit(1) to occurr.