Fixed filtering by domain so it works (although rather inefficiently) [MJ-979]