Corrected bugs and typos.