Fix issue #804

Tested as wrote Mark-H. It works fine. This affect top button and context menu in the resource tree.