Various fix for 2.2.5, including a memory corruption with 5.6.0-dev