Fixed bugs in handling of big-arity terms (arity > 255).
Authored by: dwarren 2018-04-16
Parent: [r9248]
Child: [r9250]