Fixing metadata fields filtering and its tests