testing exception handling and fix for datetime comparisons