Okay, so it makes sense that you have an overproduction of NO, which is causing the erections at night!
I would ask your doctor if there is any way of decreasing NO production.
EDIT:
Of course, we must also remember that this is only a possible cause and may not even be related to your problem, just something to look into.
Unfortunately, our biochemistry is so complex it can be difficult to pinpoint causes of our suffering. Trial and error is how we best determine the cause and the goal is to not screw ourselves up in the process!!!