Fix dependency checking corner case

[ci skip]