Merge 'Remove unnecessary out-of-bounds checks'

Closes #53 and #188

See merge request !354
3 jobs for master in 55 seconds (queued for 9 seconds)