Fix typos, remove small bugs introduced during clean-up.