Fixing possible mm heap corruption in 5.6