Fixing update equation for Gibbs sampling