Fix check for admin rights.
Fix bug when authorizing sem_app.