More robust figure handling.