Improve error reporting and fix spelling