Fix sorted insert logic
Fix address mapping compare function