Table.expand fix

After reading different sources online, this seems to fix an issue of incorrect lenght of unicode strings. 
Also added a test for that.