Backported fixes