Fixing ZeroDivisionError in replay mode