Fixes for detectColors function.