Add validation, fix profiling for a few functions.
Merge pull request #23 from rmtmckenzie/Morgan

Add validation, fix profiling for a few functions.