typos and bug fixes