Minor bugs and typos