Minor bug fixes to pathfactory