Merge "Correct boundary check and add log." am: a24539b71e am: 9b61d363e5
am: c8a1b6ffe8

Change-Id: I7a3b89747cc5326efed873c081960e83454237d1