Fix further Hacking 0.6.x warnings

* Add missing Apache license header
* Avoid using locals() in string formatting

Change-Id: Ib9fa878babae5c50bc77e48c62b33a8ebfe39f7f
Merge "Fix further Hacking 0.6.x warnings"