fixed sorting of functions, and lexing parsing fix for unclosed string params