Fix maplist function for multiple elements. Regression, close #3256

(cherry picked from commit 25a679058734bbdbaae6edf9e7743bff2c9d561e)
maplist() acceptance test

(cherry picked from commit f4ec239eb3109e122980fbad5d61cffe7f66d892)