Format date improvements, bug fixing