Bug fix and performance improvement to GICalib.