Fixes bugs in Randomizer and adds UTs