Implemented test for Inference method and pointer fix in for each
statement