sapG: valid() fix #960