Replaced few 'unwrap' and 'is_none' with 'match'
Fixed NodeId range bug
Replaced few mre 'unwrap' and 'is_none' with 'match'