Added \0 terminators. Simplified append and slices.