Fix bugs of deletion of oldest data