Fixed bugs about class methods definitions in map position and state