Altered the code to avoid spanning more than one relation.
Changed name to username to avoid confusion with the related name field.
Added the test case to report if we span more than one relation.