Better error checking; rename variable.