Improved error wording. Changed debug variable to more intuitive name.