Fixed the failing tests on master.

Closes #2878.