some changes and bug fixes to node code