Add additional assertions.
Fix some typos introduced in previous refactors.