Fixed (n)varchar(max) writing for empty strings

Also produce only (n)varchar(max) for parameters, get rid of size condition
Simplified tests