Do a better job at bounds checking