sweep2wake fixes and changes

credit to faux123