Fix a bug in getFrameRegister.