Corrected bug and typos