fix over-eager "optimization" of some unsafe-fx operations

As reported by Vincent.