Refactored a bit and changed things. It's never "<= array.size()" in a
for-loop. My bad on that one.