Fix a segfault with the material rewrite

Need to use <= instead of < on that bounds check