Error reporting bug. Fixes #320