Reworked testing code.