fix bug in simulating random effects

Fix error in simulating random effects when nlevels of a random effect variable exceeded the number of unique values. This might happen when simulating responses onto a subsetted data frame.