Better error reporting for resolveRef errors