Fix type inspection for functions with variadic arguments

Fix issue #586