Changing the nodeid type to unsigned int and adding asserts to check validity of nodeid
Changing nodeid back to int to keep it simple