Fixed it; using native random function rather than crazy Xorshift.