Fix bug which could cause infinite updates