Misc fixes

Adding license headers and fixing some NPE in the app-indexing app.