Added cleanup of empty encoded directories