Fixed database compression problem when running --scratch