add powersave fixes based on patches by Steven Luo (#4376)