Added some null pointer fixes in case the manifest is not what we expected.