better date formatting, misc bug fixes