Add missing tests, code prettyfying