Fixes problems introduced in commit b33438f4b5

…causing test failures, and other problems.