Flux periodicities in loops and junctions with d-wave superconductors