Partial fix for table store issues - updated writing of primitive values & dates

Part of the fix for #668