Bugfixes in dependency resolution