Fix nil dereference in Random(). Fix negative count in Repeat().