Fixing a bug in the splitModifiers function