Fix num category

A full fix for the bug pointed out by @rrevi in #1070 where number categories caused errors during build.