Preserve typmod

_in and _out functions work, and cast functions work when called
explicitly, but actual casting doesn’t work for some reason.