Fix for mining.

Fixes #4249