Fix typos and prepare refactor.