Handle empty strings

See https://gist.github.com/mattheworiordan/72db0dfc933f743622eb for an example that did not work.