Correct node categorization bug

Also general clean-up, documentation ...