Fixes AOF bug