fixed merchant repository and tests