Fix URL parsing to work with empty sections