Especially db_getsequence returns the true sequence length + 1. That is compensated in all referencing functions by a substraction of -1 but should be corrected in the function itself.
Other functions like get_header also returns a much greater length than expected.