Fixed the failing repository tests

Please review it
thanks