Fix bugs of resume/suspend