Fixed error in capacitor calculation