Fix for issue #400. The error object is used for different type of error...

...s, and we are not deleting its records every time we run the batch (as we did before). Thus we need to get the actual failures from the DatabaseResult instead of count the records in the Error object.