Fix catalog SQL queries to check for null start and end dates