This issue only tends to show up on very small mazes (e.g. 2x2, 3x3). It is possible for the algorithm to never generate an exit to the maze. While the algorithm guarantees with the `Z` variable that only one exit will be generated, it does not test for the situation where we just happen to never get the right random value to open an exit on the bottom row.
The simplest resolution is just to check for this before rendering the final result (i.e. `IF Z=0`), and add an exit to a random cell on the bottom row.