Fix rendering of after_text. Closes #327.