Was the save you ported to the fresh install unaffected by the bug? It sounds like the source of this glitch was from pasting a different version of DF into the same directory as the old, and any saves made from that copy of DF are glitched. If you still had a copy of that saved game that hasn't been overwritten since you switched versions, you should be able to port it from 40a to 40c without any trouble-- at least, I was able to port a game from 40a to 40c with no trouble, though I might've had temperature turned off for most of that time.
Either way, there's a simple solution for your original problem - Try turning off temperature in init. Then, nobody can burn or freeze, and it'll improve the framerate besides.
The second install may have been glitched because you could be carrying invalid data over. I have run into an issue where DF has become unbootable, usually because I would savescum in Adventure mode. Lots of 'end program' when I died, sometimes copying, deleting, replacing region file from an old copy in order to play a fort from before I'd abandoned it (in order to explore it with an adventurer of course) and that sort of thing. Even though the way I was wholly replacing the save folders shouldn't have caused a problem(I left nothing behind that would be out of sequence), problems would indeed occur, and sometimes I couldn't even boot up that install of DF.
Nowadays I just create a new DF folder (and thus a completely separate install) anytime I want to use different data or mess with the folders at all. A brand new Dwarf Fortress folder for every instance of the game, even if it's the same version. A single saved game takes up more space than a fresh install of DF, so having a separate install for each world and each "timeline" doesn't take significantly more space than having the same number of worlds in the same game folder.