I agree on those 2 points.
regarding your second point, I don't like this unrolling either.
The trick seems to be instead of :
return $mylist
Add a comma in front: return ,$mylist
https://stackoverflow.com/a/16122464This will make sure [a] never gets changed to a, and [] never gets changed to $null