Fix some calling conventions