Add test to check if finaliser is called properly