Fix ensureHeader with index

Change-Id: I368ee7061e2de7b76768e7bc72a6ecfce66e0880
android studio

Change-Id: Ia2105e424c38c3c7fecf4b8250422f4073676d3d
android studio

Change-Id: I31615bfd6e4053e2f6a0cf41e70f0bfee01c1bc7
build.gradle

Change-Id: Ifb6363e847e41929f5fafcac9af0067b2637b493
Merge remote-tracking branch 'koush/master'