MOSYNC-2831: Proper encoding