Corrected several errors