Fixed detection of current category.