Added gem export options.  Fixed a defect in the calculations pass that prematurely quit the loop.