Import fixes and improvements from colorshufflematch