Prevent infinite loop when looking up services

Reopened against 2.8-stable