Fixed a bug that would occur on cat if larger buffer was used