Fixed the generic_wfs_25d function to work with the new secondary source selection