[patch] Fixed out of bounds error, and removed some logs