Update SGPstateData and small bug fix