fixed errors in date extraction, out of border values handling
improved headers for folded periods in case of it's only one if fold