Fix two issues for databases upgraded from 0.9.x: - Compaction would fail. - GET /db/doc?attachments=true would generate a 500.