sweep2wake: fixes and code style cleanups