Do tests, fix bugs