Handles strings that contain null characters better.