Fix error in rdoc
Use reader methods for instance variables
Change instance variable to local variable