Fixed newline at end of cp buffer problem