Make sure bigint next/prev prime returns the input object type