Add type functions, improve documentation of other functions and fix a bug with the get_part_region function