Resolves #1846: fix for Access Denied exception.