Fix file appends (+test)