Made shiftCollections script robust.