Fix issue #804

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