Improve mappings for index functions.
Update to use error-result.