fix some bugs causing appender to create zillions of empty files