Fix tests
Beautify code.