BUG Tighter bounds checking
ENH Check bounds before accessing arrays