Fixing bug in repository preventing empty result sets