Fixed empty record bug. Improved the resilience of unicode output