Added ability to set the max size of the pool.