Fixing a potential memory leak with labels and buttons.