Removed $ptr and $off since we do not need it any more. Renamed $obj into $base.