Ensure that attachment ids are stored as absolute integers