Initial implementation of outage/restoration detection
Fix compilation warnings