Detect require overrides, fixes #2503