Upgraded the error messages and added dispose protection.