Fixed bug with adding a record to date other than today.
Line optimization.