bug #31: make sure to include null chars
bug #32: provision for null chars