Fixes errors in command and shell directives