[patch-warnings] fix some warnings when to inexsitant array indexes