fixed flatmap tests