Don't use deprecated warnings api.
Do proper cleanup after closing pool.