Cleanup.
Added missing include file.
Removed debug printf. Fixed inactivity checker.
Fixed idle measurement.