Fixes for the decl in the for loop

Still need to update test file and the report