Fix for mining.
Fixes #4249
Merge pull request #4253 from SkyMarshal/mining

Fix for mining.