Fixed setting dangerous restrictions

Closes #876