Merge "Add some debug logging" into pi-dev