Fixing Tests and ResourceRepository