Fix url expansion code.