fix date memory bugs
Merge branch 'tyfinal2'