Fix ouput if hostname is specified.

This is useful for Sparkling embedding.