The automatic hoist lost a footage sensor and would not operate in automatic. The hoist was operated manually until that option also stopped working. This condition was reported to MSHA at approximately 4:15 am. Upon investigation the programming for the hoist contained an error that was corrected and the hoist returned to normal operations.