Insert "return null" at the end of dangling functions