My computer programmer brother figured out what was going on. I was misinterpreting the walls template. Each of the faces is bordered by a black line, and I was making the black line belong to the wrong face. How that made the game read the edge of the square I don't know, but it's fixed now. Thanks for all your help!