Bugfix when closing boxes - fixes #72