added some cleanup when boundary vars are removed