Fixed the way smiles are read in and processed. 
Integrated changes by Eric.
Fixed selection bug.