Improve error message when <~ used with inappropriate collections.

Closes #316.