Fix a few problems in cmontecarlo.c