Fix unit tests

Many changes, some tests were not updated. No changes to actual code
just correcting the tests to the new changes.
Merge pull request #4585 from dballesteros7/unit-tests

Fix unit tests