Moved over randomization fix from Chrome extension.