Fix the static deinitialization order fiasco