Add additional error messages and comments