Improved test (with dispose)