fixed two bugs in Apply
added output file prefix option