Fixed indexoutofbounds error on precalculated DDA