applyNext hash-arg into a sequence of statements and some minor fixes