Added Close() method to middleman.