Fixed handling of . and .. paths