Fix purging of handlers