Added --failed-only option and multiple input files support