Use 1-indexing for first char of Lua string.

sub(0, 1) worked, but it's more clear to do sub(1, 1).