Fixes boundary problem in indices conversion. am: 45c9b56574 am: 5e5fa7f6ed Change-Id: I2519824d5c7992762f541ba5e10a2a2deb5ad38a