Fix bug in printing categorical type