Fixed position-mapping and extension methods to map correctly, added checking of range and mask bitvectors