Improve handling of whitespace nodes.