Fix tests and, well, real functionality