Fixed minor bug in format_source