Fixed issue with CardLayout.