Fixed a bug with removing buttons in the sidebar