Fix error reporting

Fix #19