Fix broken AFNI Automask (and maybe other AFNI tools) but may be a hack

This is a urgent PR which fixes broken AFNI Automask but may not be adequate. Feedback would be great.