Some code for SMD file reading.