Fixed some bugs in various controllers and started rebuilding the category controller.