minor update

fix a small bug
essential update

fix bug in sys_doeventstate()
Merge remote-tracking branch 'upstream/master'