Add foreach reference functions.