Fixed storage encode bug