Updated error messages and comments