Fixed permissions problems when canceling commands