Corrected a few errors in code.