Command and permission cleanup