uia: more cleanups and debugging output.

Change-Id: Ifaaebbc7826ad8421de432cb91030584b807b893