foreach spacing and reference repairs