some fixes on contrastive divergence