Converted instance variables to local ones

Converted instance variables to local ones in the test case.