Fix few bugs
add IM_AWAKE
Merge branch 'kw'