fix encoding for primitive field keys