bug fixes to path building