Fix typos and a couple code smells