Some bug fixes, relating to out-of-bounds