Finish off the category classifier and fix bug that made impossible to train classifier