Fix a nasty bug where the wrong pointer was passed to the C side.