Fix service declaration and empty sort