Simplified version of the path_join function