Deployment list fix

Fixes #1229
We should have a unit test for it as well