Fix remote lookup when pushing into registry

Those two spots look like bugs to me.