Fixed bug in writing system_name