added explicit close() calls for all 'active' entities.