Fix tests and warnings