Improve performance of os_node_autocomplete.

Relate to issue #1292