Fixing expression extraction to include all functions

Was previously dropping functions with the max arity because of an off-by-one error in the function map generation.