I can't take credit for all of this :-)
Merge pull request #521 from mbarringer/master

I can't take credit for OSEM :-)