Many were wrongly prosecuted after faulty software said money was missing from their Post Office branch accounts.