Fixes null fields and improves JSON results.