Fixed error reporting when head/tail_uuid don't match head/tail_kind for links.
Added a couple more tests.