Fix failing TestGuard test.

The resolveDependency method is documented as throwing an IllegalArgumentException
if the dependency cannot be resolved. The places that tries to resolve a dependency
on Guard now correctly handles this possibility.