People on melatonin often report steel hard wood, So not sure why its effecting you that way. You might wanna check your diet somewhere.
Dont forget if you drink juice/fizzy drinks from plastic containers/cartons some companys oddly enough line them with Estrogen mimicking plastic which can lower your test. If im not wrong, they may be using these in Water bottle material also. Just double check your diet again like I said. Neither will drinking unfiltered tap water that was said a while back to have substances in their to make people "sterile". Sorry im not trying to be some kinda paranoid nut here, but just making some suggestions that some might not give here.
Once you've got this side sorted out, look into other things like supplementation to get your test back. You might want to start looking into doing kegals + reverse kegels to help your units blood flow which people report give them rock hard wood after a few months.