A few cleanups to maze, hopefully to make it more readable/understandable.