minor improvements in timestamp fixing code