Errors for ambiguous labels.

When the user gave ambiguous labels, the code crashed in an
uncontrolled way. Now an exception with description is raised.