[SDESK-49] Fixes curve building issue where multiple exogenous curves exist

* Fix remove() element via iterator rather than directly from the collection
* Added test