Fixed duration calculation in TimeEntryModel.
Fixed stack overflow when checking for running entries.