Better detection of out-of-bounds error