Fixed bugs, errors, and typos