Changed join marker in query to @joined. Added tests.