As noticed by bertrik some code accesses an array out of its bounds Change-Id: I891d0305213ca7081c386b306f87fe9e1ba3b6c5