s3: Fix crashes in the printing code