validate: fix length calculation of string literals and store value type for literal...