Fix double adding joins
Fix readd subquery constant