coverity#1242824 Unused value

Change-Id: I5f53e538f8f76c337cda8b90fcf4ed717ed2476e
coverity#1242891 Untrusted loop bound

Change-Id: I5859cef0fa6b9c49225c5d7b073bcbc521734854