Removed duplicate line in env provider
Modified spec to check subpath case
Got rid of repeated code