Add "smart date" and some fixes