While loop improvements.