fixed bug where was not checking for errors in C extension functions
fixed bug where was not checking for errors in C extension functions