Fixed variable scoping when checking method call statements