fix spacing/indentation errors
fix format_err_msg bug