Improved error logging when an assertion fails.
Dates toLiteral should be wrapped in '' too.