Fixed closing of db before var was defined in some cases. Added catch of AttributeError in allDataIterator() when tuple dateMinutesTuple content was bad.