Fix bug with cleaning up application tags in the tests