Further improved macro output; added `when`