Fix the logic bug in Services.cpp.