Small changes to make CSnap work