Make Companion Work on Cupcake

Fix several incompatibilities which crept in during recent Companion
work. This version has been tested on Cupcake and works.

Change-Id: I8240b5f6ed2f2dda866a32780f6654e5a97215ae