Rename map to flattenMap
Only run assert test on Debug