fix 0-termination