fix ranges, fix id4, add range check in bbfr