Improve compile time bounds checking