Fixed bug in mine counting loop