more consistent behavior for BencArray::Encode and BencDict::Encode