Fix usage of rand in demo