Fix and improve synopsis code