Fix tests and upgrade packages to latest