Use write_error function
read function family
Fix identation
read_var()