Added garbage collector to clear the hub.

Fix for bug #241