Fixed get/set state issue. Pending: check the system resume/pause.