fixed bug in clone method. added append_range method. added get_mapping_between class method and get_mapping_to instance method. fixed two global variable leaks