 		let results = try pgdb.execute(query: query, parameters: [])
 		guard results.wasSuccessful else { throw DBError.queryFailed }
 		var images = [SessionImage]()
+		assert(results.rowCount >= 0)
 		for row in 0..<results.rowCount {
 			images.append(SessionImage(id: try Rc2DAO.value(columnName: "id", results: results, row: row),
 									   sessionId: try Rc2DAO.value(columnName: "sessionId", results: results, row: row),

			throw DBError.queryFailed
		}
		var projects: [Project] = []
		for row in 0..<results.rowCount {
			let project = Project(id: try Rc2DAO.value(columnName: "id", results: results, row: row),
								  version: try Rc2DAO.value(columnName: "version", results: results, row: row),

			logger.warning("error fetching workspace files: \(result.errorMessage)")
			throw ModelError.dbError
		}
		assert(result.rowCount >= 0)
		for row in 0..<fresult.rowCount {
			let aFile = try file(from: fresult, row: row)
			guard fileDict[aFile.wspaceId] != nil else {
