Harden up the code for processing s2ma files.