Fixed some issues causing test failures.