Quantum fluctuations and the current-phase relation in Josephson junctions and SQUIDs