fix bug when all divs are 0; support specifying tuning folds with a hack