Fixed join seg fault. Added delete as a function to remove a file/(empty) folder