Fix typos and type errors