Add random mode to Generator

This makes random mode actually work.