Bug and dependency fixes