Impact of substitutional and interstitial carbon defects on lattice parameters in MgB2