Fix the NodeFlags methods that are called by layout.

They should never borrow.
Merge pull request #3051 from metajack/fix-nodeflags-for-layout

Fix the NodeFlags methods that are called by layout.