Fix server deletion issues, add test refactoring

Meged with changes from 3.2-fixes

Change-Id: Ib57df38dd8bafb3e828db3abb5ce4a34fe7b5f71