Add extra validation to ShellCommand and fix setting uid and gid from username and groupname