Better handling of scalar types during output.