[FIX] Factor should be compared with factor, not id
[FIX] use inner join to avoid null id's in read_group