Fix -Warray-bounds warnings