fix a missing include and a couple of warnings.
attempt to fix constness bug
Added node type parameters