Fix condition when checking for existing local identifiers