Make flat_map work for nested somes