Code cleaning.
Tests adapted.