Fixed some repository methods and tests.

Signed-off-by: Nikola Olah <nolah@WS-NOLAH-PC.execom.co.yu>