Reworked the add dir to path function
More tests