Remove foreach dependence from demo files.
Fix a silly typo bug in midas_r.fit
Fix a silly typo bug in nbeta.gradient