Fix div by zero when no keys changed