Fixes the problem when deducing type from test agents