Fixed bug and typos