Testing fixes

All tests now pass with these changes.