loop bounds bug

Change-Id: I28c16b9c4ec1b44c2a260d6acd431fd9d22916bd