made bugfixes to comparisons involving timestamps