better error messaging. fixes #12