some improvements in figure handling