Fix variable name appearing in error message