Checkpointing. Fixed a leak in handle_free and fixed the date/time
conversion functions.
Code cleanup