Per-line annotation and various improvements