Program now exits cleanly for nonpositive N