Fixes 'marshal data too short' error