Refactored tests to toughen them.