Store character classes by character ID, fixes #8