Fix bugs in Primo service.