Refactored tests slightly.