Fixed bug in dispersive_gate_corrcetion method

Ready to merge.