Fixed path validation to cover only directory names and not invalidating path separators.