mocha test and fix node layout bugs
mocha test and fix node layout bugs