Made NodeId::save throw if the NodeId is invalid and updated test.