Why is this needed, does the `if "\0" in key` check above not work for some reason?