Fix obvious divide by zero bug. Clarify an if statement.

Hi 
in the code there was a divide by zero: if good is zero and fail > 3.
I also simplified an if statement, that works exactly the same as before. I have a feeling, that it may not do exactly, what the author wanted.