Fix for NPE crash when mining