A few fixes to improve OoM errors handling