Fix repository function pattern matching