Fixes #873 stat relation scopes

Fixes #873 stat relation scopes

This is reanimation of #926