better debugging error messages