Updating from 2.4 to 3.1, including some additional validation.
Merge pull request #3 from NGlasl/master

Update from 2.4 to 3.1, including some additional validation.