Changed the algorithm adding the toolbuttons to the toolbox. This is much more robust and adds possibility to dynamically add new tool buttons.