Fixed bug in resizing of encoded_data