Improve error reporting from C