Error checking and reporting
Corrected typos.