Bugfix in the wall matrix

- Correctly update totalBlocks when a new block row is inserted;
- Check if the number of rows that will be drawn is less then the
number of rows of the wall matrix. This avoids an "index out of
bounds" error in the wall matrix.