Added --failed-only option