Fixes typo in 'retval' variable name that caused NameError