Corrects implicit type inference when using foreach. Closes #89.
Version 5.2.0.2