Minor fixes

Clear value of upload contracts if upload is finished; Order mails by
sentDate