Fixed crash when opening the context menu.