Fixed using numeric values as category names.

Proposed fix for issue #266, but I am not sure whether it would break something else.