[BUGFIX] Do not fetch records from tables without references