Made random board generation a little more robust