Use 'join selected end nodes' with the 'edit path nodes' selector ( F2). Sweep over the whole piece and click the icon for 'join selected end nodes', all done. 
Good luck 
Dan