Add small node support and fix some bugs.
Add a test for small nodes.