Fix for #2943
Merge pull request #1764 from skirpichev/fix-rsolve

Fix for rsolve bug (#2943)