Fix tests.

+ Code beautifications.