Fix \0 handling