Extra guards in case of dodgy tempfile module