Added cleanup support (must be initialised first).