Fixed factory gas management bug