Try and fix the off-by-one error when resolving function names