Handled some incomplete URI cases

Added handling of host and source matching each other.
Added handling of . and .. at the beginning of URI.