Counting error

I started noticing that the counts of resources were off based on what I had in my Storage Facility and what was being reported by the game UI. This also stopped my mines from being emptied even when using the detailed worker tasks. Also, what may be related, my workers would sometimes leave one or two resources sitting on a plot forever. You can see both happening in the screenshot.