Slight refactor. Fixed test.