Handle scalar and lists + unit tests