Fix utf8 + improve category nodes detection