Fixed MathHelper crash
Return energy injected into machines properly.