builtins: fix for substring