Work around COOK-2171

Tested with apt-1.8.0 and apt-1.8.2
fixes #40 and fixes #41