I guess sometimes aliases is not an array?
aliases
I’ve updated the script to take that into account: