some contrastive divergence fixes