Fixed problem on reopening a corrupted database