fix bug in remapping back from C to CPP