Fixed xrange probem in profile; fixed complex number problem in Hessian

Small but important bug fixes:

* Error in profile_re, which previously had no test.  I fixed the error and added a test.

* Basic test coverage for EM

* Fix the issue that was producing a warning about complex numbers.