Added debugging output and PowerStateChangeNotifier