Added comments to explain trimming null characters for Spark compatability