[#1404] Yet another fix for the apitest type casting