Remove ending div markers

See issue #486 for explanations.