Fixed a bug with encode