Merge "Fix off by one comparison." am: 3b5dd3e421
am: 16102be4c0

Change-Id: I8dd594fe2adb07ef215a19714f758cddcc5e53bf