Fix maxfail handling

Fixed #10