Improve the handling of file ids.
Instead of messing around with the section's id, leave it alone and check for a file id whenever looking up the current id.