WIP. Bug fixes for power integration work.