Fixed potential bug with reverting data back on DLL detach