some small changes produced when trying to solve a problem on
fixStateReferences method...