Fixing incorrect slide count calculations