Elide bounds checking for some generated variable assignments
Improve range type mismatch error message
Fix an error in checking index constraints