The only production problem sounds like a change management issue. If that is the case and the software otherwise performs it purpose the first advice I would give is to resist the urge to do too much too quickly.
Source control, refactoring, more trained devs are all good suggestions, but if this is the first time you have had to deal with this sort of issue moving slowly and making controlled changes cannot be emphasized enough.
The urge to shred through the mess will be great at times, but until you have reverse engineered enoughof it that you know you can test your replacement version adequately you need to be very careful.