changed "CATEGORIES" to "categories"

because of $type = strtolower(array_shift($fieldparts)); $types can never be "CATEGORIES"