Refactored tests a bit.