Fix indentation when chaining on end

Fixes #670 and closes #672.
No update of CHANGELOG since this is a fix for an unreleased feature.