Typos.
Fix mistake in EOL or
Fixed formatting error with listing caption.
Tweaked termination condition.