Some foreach cleanups.