Fixed path bug and added tests