Inflow seems to be working. Also changed the way the generation mass is determined (SFR[i]+SFR[i-1] instead of SFR[i]+SFR[i+1],only matters really early on). Finally, changed the metallicity of the initial gas from 0 to 1e-3. This is responsible for the change in the shape of [Mg/Fe] vs [Fe/H] at low [Fe/H]