added more descriptive type errors for the c extension function