Fixed bugs, set up a configuration option for the scoped relationships