Relaxed cast helper typing to avoid problems with id<Protocol>.