Fixing possible bug cleaning memory stack (2)