Use THOR_DEBUG setting to simplify error checking in specs