Fix ordering of dependencies