Fix bug in pool refresh, and ensure that all terminated resources belong
to the user in question