Fixed compile errors.

These should be separated out into separated commits.  The unit tests
fail though.  Have not performed manual testing yet.