Fixed exceptions when opening menu.