fix regression which applied function arguments in reverse order
fix error in closure conversion of external function definitions