Fixed potential memory corruption