Make sure we always use the concrete parent table
Fix inheritance queries