random and other fixes