Earlier in this branch, I failed to properly port this logic while reworking generic functions. This commit fixes it.