Better tests, logging