Fix bugs in internal node metadata handling.