Improve error message for unexpected calls.

Fixes #1