Fixed a bug with list parameters in functions

Fixed a bug with list parameters in functions