cfi: remove typos and code cleanup