Fix for a bug when disconnecting boundary vartrees