Improved handling of messaging which include NULL characters