fix:
    * calculation of offset_ends (forget that end is not inclusive)
    * initialization of fields type and len dict