Minor cleanup of the while loop in main