Fix regression crashing bug for function calls