A better error message. Fixes #522