Fix logic error in populating categories array

* A child category was being added to the $categories
array twice.