Fixing dependency lookup with tests