Fixes to run script, including correct calculation of number of leap days.