Corrected logic for updating path.

  * Ensured directories weren't being directly repeated.