Some array bounds checking tweaks.