Corrected error message and names of variables