Add error reporting

Ran across an error, so thought that this would make things a little clearer.