Some url handling fixes and add subs