handle null bytes

Not 100% sure what the right behavior should be, but don't feel like the test should crash and not sure what else could be done.