Fix 1-byte buffer overwrites due to null-termination