Added additional checks for Date code