In the function build_lead_array on line 2577 of forms_model.php, there is a check on line 2582 "if(is_array($results) && sizeof($results) > 0)", however the closing bracket is on line 2585, and on line 2588 there is a foreach loop on the $results variable, outside the check to see if it's an array. This throws an PHP WARNING. I'm not sure if this is the root of the problem, but by moving this loop inside the bracket (placing the bracket on line 2605), it causes the notice to go away. I'm not sure if this has been addressed or mentioned already, but wanted to bring it to the attention of the developers.