Fixed an initialization bug in commonPath.
Implemented more path functions.