New category fixes

Some fixes so that a new category can be added without things messing up.