Fix nested structure formatting (fixes #255)