Fix tests and silence warnings