Fixed compiler warnings and potentional overflow
modified call to msd.Sort to match updated interface
Merge pull request #3 from RobvH/master

Resolved warnings