Fix a bug in pod listing introduced in a recent refactor.

Add a test to catch a regression in the future.