Fix tests. Clean up db