There is a clearstate() function in globals that resets some of the data when loading files. There could be other issues too.