apparently the 'safe' optimizations aren't so safe to call in arbitrary contexts. Commenting off to debug later