JB improvements to handling of figures