Use restype instead of checking every call