Fix rand in header (off by 1)