Added throws for bad exit condition.