Fixed JS error when rendering categories.