bug fixes in apply and interactive_figure