Handle invalid dependency type.
Improved docs and error messages.