Updating C extension

Updating C extension accordingly to #1030