Fixed error reporting

This fixed issue #1.

![image](https://cloud.githubusercontent.com/assets/1319906/4797536/66fe1152-5e0c-11e4-9ff9-7f2159980d29.png)