fix metadata counter for multiple services, minor whitespace cleanup