Fixed some issues with context menu permission validation.