Use Node type constants

Thanks @csillag