Updated the checking to work with variables declared using auto.