Fix addr_next calculation