Fixes of infinite loops