Added CachedDateTimeField and fixed some logic errors