Fix build ID parsing logic in stable trees