Fix list encoding to allow lists of strings, fix tests