Fix drawing of walls with heights not a power of 2

Corrections to commit 50d3c2c8b4522e636ec7261b139be2dfe6682a8e.