bugfixes in randomize